package cn.itsource.door;
public class AiDoor extends Door implements Ai {

	@Override//人脸识别方法实现
	public boolean faceRecognition() {
		System.out.println("人脸识别成功！");
		return true;
	}

	@Override
	public void openDoor() {
		//此处调用人脸识别方法，如果是true，则验证通过，开门，否则提示未授权
		boolean faceRecognition = faceRecognition();
		if (faceRecognition) {
			System.out.println("AI门开门");
		}else{
			System.out.println("未授权！");
		}
	}

	@Override
	public void closeDoor() {
		System.out.println("AI门关门");
	}

}
